clear all
set more off, permanently
set matsize 800

capture cd
if c(username)=="jcastil"{ // change user's computer domain
cd "C:\Users\Jose Castillo\Dropbox\Donald\Data bienes públicos\Supplementary materials"
}

use data.dta, clear //data set is create in stata 13 version

log using "finalresults.log", replace

********************************************************************************
* "Political Accountability and Democratic Institutions: An Experimental Assessment"
* By Jose Gabriel Castillo and John Hamman
* Journal of Experimental Political Science
* 11/12/2019
* General program
********************************************************************************


********************************************************************************
* Table 1: Experimental design and (preliminary) sample description
********************************************************************************
preserve
collapse(mean) contribution, by(subject treatment extipe)
tab treatment extipe, label
restore

********************************************************************************
* Table 2: Data Summary
********************************************************************************

///ssc install estout

forvalues i=4001/9170{
			qui replace subject=subject[`i']+200 in `i'
			qui replace group=group[`i']+40 in `i'
}

preserve 
collapse(mean) treatment woman income risk_aversion economist edcom fcnm fcv ///
		fict fiec fimcbor fimcp, by(subject)
tabstat woman income risk_aversion economist edcom fcnm fcv fict fiec fimcbor ///
		fimcp, stat(mean sd N) col(stat)
estpost summ woman income risk_aversion economist edcom fcnm fcv fict fiec ///
		fimcbor fimcp

restore

********************************************************************************
* Data analisys, by treatment
********************************************************************************

do single			// perform analysis for Single selection treatment
do multiple			// perform analysis for Multiple selection treatment

log close

